<?php 
/**
 * alltosun.com 发送短信
 * ============================================================================
 * 版权所有 (C) 2009-2011 北京互动阳光科技有限公司，并保留所有权利。
 * 网站地址: http://www.alltosun.com
 * ----------------------------------------------------------------------------
 * 许可声明：这是一个开源程序，未经许可不得将本软件的整体或任何部分用于商业用途及再发布。
 * ============================================================================
 * $Author: 高昂 (gaoa@alltosun.com) $
 * $Date: 2016-5-13 下午4:28:15 $
 * $Id: $
 */

class msg_widget
{
    /**
    * 发给所有的影院端
    */
    public function send_all_movie_store($is_send = 0)
    {
        // new_app_for_movie_store
        $sms_res_name = 'new_app_tip_for_movie_store';
    
        $list = array();
        //if (1) {
            $store_filter['type'] = 100;
            $store_filter['is_delete'] = 1;
            $store_list = _model('store')->getFields('user_id', $store_filter);
       // } else {
            //$dealer_info = user_helper::get_user_info_by_mobile('15555555555');
            //$dealer_info = user_helper::get_user_info_by_mobile('18844100485');
            //$store_filter['type'] = 100;
            //$store_filter['agency_id'] = $dealer_info['id'];
            //$store_list = _model('store')->getFields('user_id', $store_filter);
        //}
   
	var_dump($store_filter); 
        $owner_store_list = _model('store')->getFields('owner_id', $store_filter);
        $list = array_unique(array_merge($store_list, $owner_store_list));
    
        $i = 0;
        if ($list) {
            foreach ($list as $k=>$v) {
                $user_info = user_helper::get_user_info($v);
                if (!$user_info) {
                    continue;
                }
                $msg_arr = array('name'=>$user_info['realname']);
		//var_dump($user_info);
		echo $user_info['mobile'];
		echo "\n";
		$mobile = $user_info['mobile'];
                aliysms_helper::sms_send('抱抱堂', $msg_arr, $mobile, $sms_res_name);
                //message_center_helper::get_config_add_message($sms_res_name, $msg_arr, $v, 'store', '', 0, 'arrival');
               // echo $i++,'<br/>';
            }
        }
    
        echo '发送成功';
    }
}



?>
